package 作业2;

public class Student extends Person {
    String no;
    double scoreEn;
    double scoreMah;
    double scoreCh;


    public void aver() {
        double aver=(scoreCh+scoreEn+scoreMah)/3;

        System.out.println(name + "平均分:"+aver);

    }

    public void Max() {
        double max = Math.max(scoreEn, scoreMah);
        double result = Math.max(max,scoreCh);
        System.out.println(name + "最高分:"+result);

    }

    public void Min() {
        double min = Math.min(scoreEn, scoreMah);
        double min1 = Math.min(min, scoreCh);
        System.out.println(name + "最低分:"+min1);
    }

    @Override
    public String toString() {
        return "Student{" +
                "no='" + no + '\'' +
                ", scoreEn=" + scoreEn +
                ", scoreMah=" + scoreMah +
                ", scoreCh=" + scoreCh +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }
}
